package org.zxy.base.listener;

import org.springframework.beans.factory.annotation.Autowired;
import org.zxy.base.service.impl.AutoScanPermissionServiceImpl;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

@WebListener
public class InitDataListener implements ServletContextListener {

    @Autowired
    private AutoScanPermissionServiceImpl autoScanPermissionService;

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        System.out.println("===========容器初始化开始============");
        autoScanPermissionService.scan();
        System.out.println("===========容器初始化结束============");
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        System.out.println("===========容器销毁============");
    }
}
